package com.micro.modual.extension;

import com.micro.common.MicroConstant;
import com.micro.common.biz.GeneratorCodeUtil;
import com.micro.common.util.SnowFlakeUtil;
import com.micro.modual.entity.Order;
import com.micro.modual.model.bo.order.OrderBO;

/**
 * <h1>订单基础表 延展类</h1>
 * @author LevelCoder
 * @version V1.0.0
 * @email LevelCoder@126.com
 * @date 2020-08-04 00:23:26
 */
public class OrderExtension {

    /**
     * <h2>转换: 订单基础表 新增</h2>
     * @param orderBO {@link OrderBO} 订单基础表 新增/修改 请求对象
     * @return {@link Order} 订单基础表
     */
    public static Order converAddOrder(OrderBO orderBO) {
        Order order = new Order();
        order.setId(SnowFlakeUtil.getId());
                                                            order.setOrderCode(orderBO.getOrderCode());
                                                    order.setOrderType(orderBO.getOrderType());
                                                    order.setCreateTime(orderBO.getCreateTime());
                                                    order.setFinishTime(orderBO.getFinishTime());
                                                    order.setPayTime(orderBO.getPayTime());
                                                    order.setDeliveryTime(orderBO.getDeliveryTime());
                                                    order.setCloseTime(orderBO.getCloseTime());
                                                    order.setOrderStatus(orderBO.getOrderStatus());
                                                    order.setOrderRemark(orderBO.getOrderRemark());
                                                    order.setOrderGoodsTotalNumber(orderBO.getOrderGoodsTotalNumber());
                                                    order.setOrderPostage(orderBO.getOrderPostage());
                                                    order.setOrderTotalPrice(orderBO.getOrderTotalPrice());
                                                    order.setOrderTotalDiscountPrice(orderBO.getOrderTotalDiscountPrice());
                                                    order.setPayType(orderBO.getPayType());
                                                    order.setOrderSourceType(orderBO.getOrderSourceType());
                                                    order.setUserCode(orderBO.getUserCode());
                                                    order.setCloseDesc(orderBO.getCloseDesc());
                                                    order.setReturnPayNo(orderBO.getReturnPayNo());
                                                    order.setOrderEffectiveStatus(orderBO.getOrderEffectiveStatus());
                                                    order.setReceiverName(orderBO.getReceiverName());
                                                    order.setReceiverPhone(orderBO.getReceiverPhone());
                                                    order.setProvinceName(orderBO.getProvinceName());
                                                    order.setCityName(orderBO.getCityName());
                                                    order.setAreaName(orderBO.getAreaName());
                                                    order.setOrderAddress(orderBO.getOrderAddress());
                                                    order.setOrderActualPrice(orderBO.getOrderActualPrice());
                                                    order.setExtractionType(orderBO.getExtractionType());
                                                    order.setUpdateTime(orderBO.getUpdateTime());
                                                    order.setExpressName(orderBO.getExpressName());
                                                    order.setExpressNo(orderBO.getExpressNo());
                                                    order.setCommentStatus(orderBO.getCommentStatus());
                                                    order.setIncludingGlasses(orderBO.getIncludingGlasses());
                                                    order.setUserEyesDetail(orderBO.getUserEyesDetail());
                            return order;
    }

    /**
     * <h2>转换: 订单基础表 修改</h2>
     * @param orderBO {@link OrderBO} 订单基础表 新增/修改 请求对象
     * @return {@link Order} 订单基础表
     */
    public static Order converEditOrder(OrderBO orderBO) {
        Order order = new Order();
        order.setId(orderBO.getId());
                                                        order.setOrderCode(orderBO.getOrderCode());
                                                order.setOrderType(orderBO.getOrderType());
                                                order.setCreateTime(orderBO.getCreateTime());
                                                order.setFinishTime(orderBO.getFinishTime());
                                                order.setPayTime(orderBO.getPayTime());
                                                order.setDeliveryTime(orderBO.getDeliveryTime());
                                                order.setCloseTime(orderBO.getCloseTime());
                                                order.setOrderStatus(orderBO.getOrderStatus());
                                                order.setOrderRemark(orderBO.getOrderRemark());
                                                order.setOrderGoodsTotalNumber(orderBO.getOrderGoodsTotalNumber());
                                                order.setOrderPostage(orderBO.getOrderPostage());
                                                order.setOrderTotalPrice(orderBO.getOrderTotalPrice());
                                                order.setOrderTotalDiscountPrice(orderBO.getOrderTotalDiscountPrice());
                                                order.setPayType(orderBO.getPayType());
                                                order.setOrderSourceType(orderBO.getOrderSourceType());
                                                order.setUserCode(orderBO.getUserCode());
                                                order.setCloseDesc(orderBO.getCloseDesc());
                                                order.setReturnPayNo(orderBO.getReturnPayNo());
                                                order.setOrderEffectiveStatus(orderBO.getOrderEffectiveStatus());
                                                order.setReceiverName(orderBO.getReceiverName());
                                                order.setReceiverPhone(orderBO.getReceiverPhone());
                                                order.setProvinceName(orderBO.getProvinceName());
                                                order.setCityName(orderBO.getCityName());
                                                order.setAreaName(orderBO.getAreaName());
                                                order.setOrderAddress(orderBO.getOrderAddress());
                                                order.setOrderActualPrice(orderBO.getOrderActualPrice());
                                                order.setExtractionType(orderBO.getExtractionType());
                                                order.setUpdateTime(orderBO.getUpdateTime());
                                                order.setExpressName(orderBO.getExpressName());
                                                order.setExpressNo(orderBO.getExpressNo());
                                                order.setCommentStatus(orderBO.getCommentStatus());
                                                order.setIncludingGlasses(orderBO.getIncludingGlasses());
                                                order.setUserEyesDetail(orderBO.getUserEyesDetail());
                            return order;
    }
}
